import torch
from torch import nn

input = torch.tensor([[[[1, 2, 0, 3, 1],
                        [0, 1, 2, 3, 1],
                        [1, 2, 1, 0, 0],
                        [5, 2, 3, 1, 1],
                        [2, 1, 0, 1, 1]]]], dtype=torch.float32) # dtype为整数也可以

pool1 = nn.MaxPool2d(3, ceil_mode=True)
pool2 = nn.MaxPool2d(3, ceil_mode=False)

print(pool1(input))
print(pool2(input))
